<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title></title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}

.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}

.STYLE6 {
	color: #000000;
	font-size: 12;
}

.STYLE10 {
	color: #000000;
	font-size: 12px;
}

.STYLE19 {
	color: #344b50;
	font-size: 12px;
}

.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}

.STYLE22 {
	font-size: 12px;
	color: #295568;
}
-->
</style>
<script>
//跳转页面
function choosePage(courseId,intPageCount){
	//即将跳转页数
	var page = window.document.getElementById("page").value;
	if(page ==  "" || parseInt(page) < 1 || parseInt(page)> intPageCount){
		alert("输入的页数错误");
	}else{
		window.location.href= "userAuditing?intPage="+page;
	}
	
}

//全选
function allchoose(){
	var checkbox = window.document.getElementById("checkbox").checked;
	if(checkbox){
		var b = window.document.getElementsByName("checkboxList");
		for ( var i = 0; i < b.length; i++) {
			b[i].checked = true;
		}
	}else{
		var b = window.document.getElementsByName("checkboxList");
		for ( var i = 0; i < b.length; i++) {
			b[i].checked = false;
		}
	}	
}

//全选2
function allchoose2(){
	var a = window.document.getElementsByName("checkboxList");
	if(a[0].checked){
		for ( var i = 0; i < a.length; i++) {
			a[i].checked = true;
		}
	}else{
		for ( var i = 0; i < a.length; i++) {
			a[i].checked = false;
		}
	}	
}

	var  highlightcolor='#d5f4fe';
	//此处clickcolor只能用win系统颜色代码才能成功,如果用#xxxxxx的代码就不行,还没搞清楚为什么:(
	var  clickcolor='#51b2f6';
	function  changeto(){
		source=event.srcElement;
		if  (source.tagName=="TR"||source.tagName=="TABLE")
			return;
		while(source.tagName!="TD")
			source=source.parentElement;
			source=source.parentElement;
			cs  =  source.children;
		//alert(cs.length);
		if  (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor)
		for(var i=0;i<cs.length;i++){
			cs[i].style.backgroundColor=highlightcolor;
		}
	}

	function  changeback(){
		if  (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="nc")
			return
		if  (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
			//source.style.backgroundColor=originalcolor
			for(var i=0;i<cs.length;i++){
				cs[i].style.backgroundColor="";
		}
	}

	function  clickto(){
		source=event.srcElement;
		if  (source.tagName=="TR"||source.tagName=="TABLE")
			return;
		while(source.tagName!="TD")
		source=source.parentElement;
		source=source.parentElement;
		cs  =  source.children;
		//alert(cs.length);
		if  (cs[1].style.backgroundColor!=clickcolor&&source.id!="nc")
			for(var i=0;i<cs.length;i++){
				cs[i].style.backgroundColor=clickcolor;
			}
		else
			for(var i=0;i<cs.length;i++){
				cs[i].style.backgroundColor="";
		}
}
</script>
</head>

<body>

	<table width="100%" border="0" align="center" cellpadding="0"
		cellspacing="0">
		<!-- 第一行 -->
		<tr>
			<td height="30">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td height="24" bgcolor="#353c44">
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td>
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tr>
												<td width="6%" height="19">
													<div align="center">
														<img src="images/tb.gif" width="14" height="14" />
													</div>
												</td>
												<td width="15%" height="19"><span class="STYLE1">注册审核</span>
												</td>
												<td width="79%" height="19">
													<form id="studentShowForm"	action="userQuery?intPage=1"
														method="post" style="margin:0px">
														<span class="STYLE1">真实姓名:</span> <input type="text"
															name="realname" maxlength="12"
															style="height:19;vertical-align:middle" /> <input
															type="submit" value="查找"
															style="height:19;vertical-align:middle" />
													</form>
												</td>

											</tr>
										</table>
									</td>

								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>

		<!-- 第二行 -->
		<tr>
			<td><table width="100%" border="0" cellpadding="0"
					cellspacing="1" bgcolor="#a8c7ce" onmouseover="changeto()"
					onmouseout="changeback()">
					<tr>
						<td width="5%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">用户ID</span>
							</div></td>
						<td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">用户名</span>
							</div></td>
						<td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">真实姓名</span>
							</div></td>
						<td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">电话</span>
							</div></td>
						<td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">电子邮箱</span>
							</div></td>
						<td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">学院</span>
							</div></td>
						<td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">年级</span>
							</div></td>
						<td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">专业</span>
							</div></td>
						<td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">班级</span>
							</div></td>
						<td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">创建时间</span>
							</div></td>
						<td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">用户状态</span>
							</div></td>
						<td width="11%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">操作</span>
								</div></td>


					</tr>

					<s:iterator value="#request.userListBean.userList">
						<tr>
							<td height="20" bgcolor="#FFFFFF" class="STYLE6"><div
									align="center">
									<span class="STYLE19"><s:property value="userId" /></span>
								</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
									align="center">
									<s:property value="username" />
								</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
									align="center">
									<s:property value="realname" />
								</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
									align="center">
									<s:property value="phone" />
								</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
									align="center">
									<s:property value="email" />
								</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
									align="center">
									<s:property value="institute" />
								</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
									align="center">
									<s:property value="grade" />
								</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
									align="center">
									<s:property value="major" />
								</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
									align="center">
									<s:property value="classes" />
								</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
									align="center">
									<s:property value="creationTime" />
								</div></td>
							<s:if test="#request.userStatus == 1 || #request.userStatus == 3">
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										未审核
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<a
											href="userPass?userId=<s:property value="userId" />">审核通过</a>
									</div>
								</td>
							</s:if>
							<s:elseif test="#request.userStatus == 2 || #request.userStatus == 4">
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										审核通过
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<a
											href="userForbid?userId=<s:property value="userId" />">禁用该用户</a>
									</div>
								</td>
							</s:elseif>
							<s:elseif test="#request.userStatus == 5">
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										已删除
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<a
											href="userPass?userId=<s:property value="userId" />">启用该用户</a>
									</div>
								</td>
							</s:elseif>
						</tr>
					</s:iterator>
				</table></td>
		</tr>

		<!-- 第三行 -->
		<tr>
			<td height="30"><table width="100%" border="0" cellspacing="0"
					cellpadding="0">
					<tr>
						<td width="33%"><div align="left">
								<span class="STYLE22">&nbsp;&nbsp;&nbsp;&nbsp;共有<strong>
										${request.pageInfoBean.intRowCount}</strong> 条记录，当前第<strong>
										${request.pageInfoBean.intPage}</strong> 页，共 <strong>${request.pageInfoBean.intPageCount}</strong>
									页
								</span>
							</div></td>
						<td width="67%">
							<table width="312" border="0" align="right" cellpadding="0"
								cellspacing="0">
								<tr>
									<!-- 首页 -->
									<td width="49">
										<div align="center">
											<a href="userAuditing?intPage=1"><img
												src="images/main_54.gif" width="40" height="15" /></a>
										</div>
									</td>

									<!-- 既没有“上一页”，也没有“下一页” -->
									<s:if test="#request.pageInfoBean.intPageCount == 1">
										<td width="49"><div align="center">
												<img src="images/main_56.gif" width="45" height="15" />
											</div></td>
										<td width="49"><div align="center">
												<img src="images/main_58.gif" width="45" height="15" />
											</div></td>
									</s:if>

									<!-- 只有“下一页” -->

									<s:elseif
										test="(#request.pageInfoBean.intPageCount > 1) && (#request.pageInfoBean.intPage == 1) ">
										<td width="49"><div align="center">
												<img src="images/main_56.gif" width="45" height="15" />
											</div></td>
										<td width="49"><div align="center">
												<a
													href="userAuditing?intPage=${request.pageInfoBean.intPage+1}"><img
													src="images/main_58.gif" width="45" height="15" /></a>
											</div></td>
									</s:elseif>

									<!-- 有“上一页”“下一页” -->
									<s:elseif
										test="(#request.pageInfoBean.intPage < #request.pageInfoBean.intPageCount) && (#request.pageInfoBean.intPage > 1) ">
										<td width="49"><div align="center">
												<a
													href="userAuditing?intPage=${request.pageInfoBean.intPage-1}"><img
													src="images/main_56.gif" width="45" height="15" /></a>
											</div></td>
										<td width="49"><div align="center">
												<a
													href="userAuditing?intPage=${request.pageInfoBean.intPage+1}"><img
													src="images/main_58.gif" width="45" height="15" /></a>
											</div></td>
									</s:elseif>

									<!-- 只有“上一页” -->

									<s:elseif
										test="(#request.pageInfoBean.intPage == #request.pageInfoBean.intPageCount) && (#request.pageInfoBean.intPage > 1)">
										<td width="49"><div align="center">
												<a
													href="userAuditing?intPage=${request.pageInfoBean.intPage-1}"><img
													src="images/main_56.gif" width="45" height="15" /></a>
											</div></td>
										<td width="49"><div align="center">
												<img src="images/main_58.gif" width="45" height="15" />
											</div></td>
									</s:elseif>

									<!-- 尾页 -->
									<td width="49"><div align="center">
											<a
												href="userAuditing?intPage=${request.pageInfoBean.intPageCount}"><img
												src="images/main_60.gif" width="40" height="15" /></a>

										</div></td>

									<!-- 转到？页 -->
									<td width="37" class="STYLE22"><div align="center">转到</div></td>
									<td width="22"><div align="center">
											<input type="text" name="page" id="page"
												style="width:20px; height:15px; font-size:12px; border:solid 1px #7aaebd;" />
										</div></td>
									<td width="22" class="STYLE22"><div align="center">页</div></td>
									<td width="35"><img src="images/main_62.gif" width="26"
										height="15"
										onclick="choosePage('${request.pageInfoBean.intPageCount}')" /></td>
								</tr>
							</table>
						</td>
					</tr>
				</table></td>
		</tr>
	</table>
</body>
</html>
